let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start"),
                    Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.UIMrg = void 0);
                var n = t('UILayer'),
                    i = t('ClassUtils'),
                    r = t('ResMrg'),
                    a = t('GlobalEventMrg'),
                    s = t('UIEvent'),
                    c = (function() {
                        function t() {}
                        return (
                            (t.init = function(e) {
                                for (var o in ((t._root = e),
                                        (t.uiLayers = []),
                                        (t.showLayers = []),
                                        n.UILayer)) {
                                    if ('string' == typeof o && !isNaN(parseInt(o))) {
                                        var i = new cc.Node(),
                                            r = i.addComponent(cc.Widget);
                                        (i.name = o),
                                        (r.alignMode = cc.Widget.AlignMode.ON_WINDOW_RESIZE),
                                        (r.isAlignTop = !0),
                                        (r.isAlignLeft = !0),
                                        (r.isAlignRight = !0),
                                        (r.isAlignBottom = !0),
                                        (r.top = 0),
                                        (r.left = 0),
                                        (r.right = 0),
                                        (r.bottom = 0),
                                        (r.target = e),
                                        r.updateAlignment(),
                                            e.addChild(i),
                                            (t.uiLayers[o] = i);
                                    }
                                }
                            }),
                            Object.defineProperty(t, 'root', {
                                get: function get() {
                                    return this._root;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (t.update = function(t) {
                                for (var e in this.clazzMap) {
                                    var o = this.clazzMap[e];
                                    o && o.isShow && o.update(t);
                                }
                            }),
                            (t.addPanel = function(e, o) {
                                if (null != e && null != o) {
                                    var n = e.RES,
                                        r = i.default.getClassName(e);
                                    if (null == t.clazzMap[r]) {
                                        var a = new e(o);
                                        a.init(), a.setLayer(n.layer), (t.clazzMap[r] = a);
                                    }
                                }
                            }),
                            (t.show = function(e, o) {
                                if ((void 0 === o && (o = null), e)) {
                                    var n = i.default.getClassName(e),
                                        a = this.clazzMap[n];
                                    if (null == a) {
                                        var s = e.RES;
                                        s &&
                                            r.ResMrg.loadView(s.viewName, s.packName, function(i) {
                                                i &&
                                                    ((a = new e(i)).setLayer(s.layer),
                                                        a.init(),
                                                        (t.clazzMap[n] = a),
                                                        t.showPanel(a, o));
                                            });
                                    } else t.showPanel(a, o);
                                }
                            }),
                            (t.havePanelByLayer = function(t) {
                                for (var e in this.clazzMap) {
                                    var o = this.clazzMap[e];
                                    if (o && o.isShow)
                                        for (var n = 0; n < t.length; n++) {
                                            if (o.layer == t[n]) return !0;
                                        }
                                }
                                return !1;
                            }),
                            (t.showPanel = function(e, o) {
                                void 0 === o && (o = null),
                                    e &&
                                    (i.default.getClassName(e),
                                        e.isShow ?
                                        e.setData(o) :
                                        (t.addToLayer(e), e.setData(o), e.show()),
                                        a.default.emit(s.UIEvent.Show, e));
                            }),
                            (t.close = function(t) {
                                var e = i.default.getClassName(t),
                                    o = this.clazzMap[e];
                                o &&
                                    o.isShow &&
                                    (o.close(),
                                        o.effect || (o.view.parent = null),
                                        a.default.emit(s.UIEvent.Close, o));
                            }),
                            (t.closeAll = function() {
                                for (var t in this.clazzMap) {
                                    var e = this.clazzMap[t];
                                    e && e.isShow && e.close();
                                }
                                a.default.emit(s.UIEvent.Close);
                            }),
                            (t.getPanel = function(t) {
                                var e = i.default.getClassName(t);
                                return this.clazzMap[e];
                            }),
                            (t.addToLayer = function(t) {
                                if (t) {
                                    var e = this.uiLayers[t.layer];
                                    if (e) {
                                        var o = this.showLayers[t.layer];
                                        o && o.isShow && this.close(o),
                                            (this.showLayers[t.layer] = t),
                                            e.addChild(t.view);
                                    }
                                }
                            }),
                            (t.call = function(e, o) {
                                for (var n = [], r = 2; r < arguments.length; r++) {
                                    n[r - 2] = arguments[r];
                                }
                                var a = i.default.getClassName(e),
                                    s = t.clazzMap[a];
                                s &&
                                    s[o] &&
                                    (n ? (n.length > 1 ? s[o](n) : s[o](n[0])) : s[o]());
                            }),
                            (t.clazzMap = {}),
                            t
                        );
                    })();
                (o.UIMrg = c), console.log("end");
            module.exports =  e.exports;